package com.xiaoqi.store.dao;

import com.xiaoqi.store.entity.AddressEntity;

import java.util.List;

/*
* @Author xiaoqi
* @Description  关于地址的数据持久层接口
* @return
**/
public interface AddressMapper {

    /*
     * @Author xiaoqi
     * @Description  添加用户收货地址
     * @return int
     **/

     int addUserAddress(AddressEntity addressEntity);

    /*
     * @Author xiaoqi
     * @Description  判断用户收货地址数量是否大于20
     * @return int
     **/

     int selectUserAddressCount(Integer uid);

     /*
     * @Author xiaoqi
     * @Description  查询用户的所有收货地址
     * @return List<Address>
     **/
     List<AddressEntity> selectUserAllAddress(Integer uid);

     /*
     * @Author xiaoqi
     * @Description  根据收货地址编号查询收货地址信息
     * @return Address
     **/
     AddressEntity findUserAddressByAid(Integer aid);

     /*
     * @Author xiaoqi
     * @Description  将当前用户的所有收货地址都改为默认
     * @return int
     **/
     int updateUserDefaultAddressToNone(Integer uid);

     /*
     * @Author xiaoqi
     * @Description  将当前用户指定的收货地址改为默认收货地址
     * @return int
     **/
     int updateUserDefaultAddress(Integer aid);

     /*
     * @Author xiaoqi
     * @Description  根据指定收货地址编号删除收货地址
     * @return
     **/
     int deleteAddressByAid(Integer aid);
}
